Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Takes a string, returns a url friendly string. Works in browser and node. Dead simple.
Dead simple slugification for node and browser.
Converts any string into a url friendly version:
slugger('Hello yOu CRAZY Swede!'); // returns 'hello-you-crazy-swede'
// optionally maintain case
slugger('Hello yOu CRAZY Swede!', {maintainCase: true}); // returns 'Hello-yOu-CRAZY-Swede'
// optionally use a different replacement character
slugger('Hello yOu CRAZY Swede!', {replacement: '_'}); // returns 'hello_you_crazy_swede'
// optionally trim to max length while not breaking any words
slugger('Hello yOu CRAZY Swede!', {smartTrim: 9}); // returns 'hello-you'
// optionally allow additional characters
// just pass string of characters that would normally be removed
// that you want to allow.
slugger('Hello yOu CRAZY Swede!', {alsoAllow: "!&"}); // returns 'hello-you-crazy-swede!'
// decodes URI components by default, so {decode: true} is not required
slugger('boo%20boo') // returns 'boo-boo';
// now without decode
slugger('boo%20boo', {decode: false}) // returns boo20boo;
That's all there is to it!
npm install slugger
Or just grab the slugger.js file and drop it into your project.
It also plays nicely with: https://github.com/henrikjoreteg/clientmodules
Because I wanted something simpler that didn't try to do anything with special characters or unicode and I wanted something that worked well in the browser or node.
Just run npm test
Then you should probably follow @HenrikJoreteg on twitter.
MIT
FAQs
Takes a string, returns a url friendly string. Works in browser and node. Dead simple.
The npm package slugger receives a total of 451 weekly downloads. As such, slugger popularity was classified as not popular.
We found that slugger demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.